User Interface Procedures The following tables summarize the procedures that make up the User Interface toolbox. These functions are provided in four separate toolbox files. The files are. * MENU.BAS * WINDOW.BAS * MOUSE.BAS * GENERAL.BAS Each table lists the type of operation performed by the procedure, the procedure name, and the result of the procedure. See the detailed description of each of the procedures later in this part for more information about how to use them in your programs. Menu SUB and FUNCTION Procedures Initialize variables and preprocess menus ----------------------------------------- MenuInit Initializes global menu arrays and mouse driver servicing routines. MenuPreProcess Performs calculations and builds indexes so menus run faster. Define and display menus ------------------------ MenuColor Assigns color to various components of the menus. MenuSet Defines the structure of menus and the quick keys associated with each menu selection. MenuShow Draws the menu across the top line of the screen. Change the state of menus or menu items --------------------------------------- MenuItemToggle Toggles the state of a menu item between enabled but not selected and enabled and selected. MenuSetState Explicitly assigns the state of a menu item. States are. empty (menu item does not appear on the menu); enabled but not selected; enabled and selected; and disabled. Process menu events ------------------- MenuCheck Provides a numeric indication of what menu selection, if any, was made following a menu or shortcut-key event. MenuEvent$ Monitors user input to determine if a menu choice is being made with either the mouse or the keyboard. MenuInkey$ Performs a BASIC INKEY$ function as well as a MenuEvent$ and ShortCutKeyEvent$ function. MenuOff Turns off menu and shortcut-key event processing. MenuOn Turns on menu and shortcut-key event processing that was previously turned off. Shortcut keys ------------- ShortCutKeyDelete$ Revokes any previous shortcut-key definitions associated with a particular menu item. ShortCutKeyEvent$ Polls user input to determine if a menu item was selected using a shortcut key. ShortCutKeySet Assign shortcut keys to individual menu items. Window SUB and FUNCTION Procedures Initialize window variables --------------------------- WindowInit Initializes global variables for all procedures in WINDOW.BAS. Define windows -------------- WindowBox Draws a box with a single-line border at a designated position within the current window. WindowClose Closes a specified window. WindowColor Changes color characteristics of the current window. WindowOpen Defines the size, position, color, and other characteristics of individual windows. WindowSetCurrent Makes the specified window the current window. Get information about windows ----------------------------- WindowCols Returns the number of columns in the current window. WindowCurrent Returns the number of the current window handle. WindowNext Returns the number of the next available window handle. WindowRows Returns the number of rows in the current window. Display text in windows ----------------------- WindowCls Clears all text from within a window. WindowLine Draws a horizontal line across a window at the row specified. WindowLocate Sets the row and column of the window text cursor to define the next position where a character will be printed. WindowPrint Prints text in a window at the position established by WindowLocate. WindowScroll Scrolls text, in the current window, the number of lines specified. Button actions -------------- ButtonClose Erases the specified button from the current window and deletes it from the global arrays. ButtonInquire Returns a value that indicates the state of the specified button. Only used with button types 1, 2, 3, 6, and 7. ButtonOpen Opens a button of a specified type and places it in the current window at the specified window coordinates. ButtonSetState Sets the state of the specified button in the current window. ButtonToggle Toggles the state of the specified button between selected and not selected. Edit field actions ------------------ EditFieldClose Erases the specified edit field from the current window and deletes it from the global arrays. EditFieldInquire Returns the string associated with the specified edit field. EditFieldOpen Opens an edit field and places it in the current window at specified coordinates. Miscellaneous actions --------------------- Alert Displays a window containing between one and three buttons that indicate user choices. Returns a value that indicates the number of the button selected by the user. Dialog Returns a value that indicates what type of button, edit field, or window event occurred during window-event processing. ListBox Displays a window containing a list box, a scroll bar, an OK button, and a Cancel button. Returns a value that indicates the number of the item selected in the list box, or 0 if Cancel is selected. MaxScrollLength Returns a value that indicates how many positions are available on a specified scroll bar. Mouse SUB Procedures Initialize the mouse -------------------- MouseDriver Calls Interrupt 51 (33H) and passes parameters to the proper CPU registers. MouseInit Initializes mouse driver servicing routines. Establish limits of mouse movement on the screen ------------------------------------------------ MouseBorder Defines the area where the mouse can be used. Manipulate the mouse -------------------- MouseHide Turns off display of the mouse cursor. MousePoll Polls the mouse driver to establish the position of the mouse cursor and the status of mouse buttons. MouseShow Turns on display of the mouse cursor. General SUB and FUNCTION Procedures Accept and evaluate keyboard input ---------------------------------- AltToASCII$ Decodes extended key codes associated with the Alt key and returns an individual ASCII character. GetShiftState Returns the status of one of eight possible shift states. Manipulate screen areas ----------------------- AttrBox Changes color attributes of text within an area described by specified row and column coordinates. Box Draws a box around a defined area using specified foreground and background colors. GetBackground Saves an area of the screen into a named buffer. PutBackground Restores to specified coordinates a previously saved screen area from a named buffer. Scroll Scrolls the defined area a specified number of lines.